{{define "infoCollection/CVUS.html"}}
<form class="form-horizontal" id="CVUSForm">
    <div class="box-body">
        <div class="box box-info" style="box-shadow: none;margin-bottom: 0;">
            <div class="box-header with-border">
                <h3 class="box-title">血管颈部超声</h3>
            </div>
            <div class="box-body">
                <div class="form-group">
                    <label class="col-sm-1 control-label">检查时间:</label>
                    <div class="col-sm-2">
                        <div class="input-group date">
                            <div class="input-group-addon">
                                <i class="fa fa-calendar"></i>
                            </div>
                            <input type="text" name="cvusCheckDate" id="cvusCheckDate" class="form-control pull-right">
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">检查人：</label>
                    <div class="col-sm-2">
                        <input type="text" name="cvusCheckPerson" id="cvusCheckPerson" class="form-control pull-right">
                    </div>
                    <label class="col-sm-1 control-label">检查机构：</label>
                    <div class="col-sm-2">
                        <input type="text" name="cvusCheckOrgan" id="cvusCheckOrgan" class="form-control pull-right">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-sm-1">
                        检查结果:
                    </label>
                    <div class="radio col-sm-3">
                        <input type="radio" name="cvus_is_zhengchang" value="全部正常" class="minimal">&nbsp;&nbsp;全部正常
                        <input type="radio" name="cvus_is_zhengchang" value="任一部位有异常" class="minimal">&nbsp;&nbsp;任一部位有异常
                    </div>
                </div>
                <style>
                    .cvus input {
                        width: 30px;
                        margin: 8px;
                        padding: 2px;
                        border-left: none;
                        border-top: none;
                        border-right: none;
                        border-radius: 0;
                        box-shadow: none;
                        border-bottom: 1px solid #0b93d5;
                        color: red;
                        font-weight: bold;

                    }

                    .cvus tr td {
                        text-align: center;
                        vertical-align: middle;
                    }

                </style>
                <table border="1" width="100%" class="cvus">
                    <tr style="text-align: center;">
                        <td rowspan="3">异常类型</td>
                        <td rowspan="3">异常项目</td>
                        <td colspan="10">责任病灶部位</td>
                    </tr>
                    <tr style="text-align: center;">
                        <td colspan="5">左侧</td>
                        <td colspan="5">右侧</td>
                    </tr>
                    <tr style="text-align: center;">
                        <td>颈总</td>
                        <td>窦部</td>
                        <td>颈内</td>
                        <td>锁骨下动脉SA</td>
                        <td>椎动脉VA</td>
                        <td>颈总</td>
                        <td>窦部</td>
                        <td>颈内</td>
                        <td>锁骨下动脉SA</td>
                        <td>椎动脉VA</td>
                    </tr>
                    <tr>
                        <td style="text-align: center;">内膜IMT</td>
                        <td>增厚(0=否,1=是)厚度:<input type="text"  name="neimo_IMT_houdu" id="neimo_IMT_houdu"/>mm</td>
                        <td><input type="text" name="neimo_IMT_left_jingzong" id="neimo_IMT_left_jingzong"/></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td><input type="text" name="neimo_IMT_right_jingzong" id="neimo_IMT_right_jingzong"/></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="text-align: center;" rowspan="4">斑块</td>
                        <td>数量</td>
                        <td colspan=10 height="50px;">
                            <div class="radio col-sm-6">
                                <input type="radio" name="bankuai_shuliang" value="无" class="minimal">&nbsp;&nbsp;无
                                <input type="radio" name="bankuai_shuliang" value="单发" class="minimal">&nbsp;&nbsp;单发
                                <input type="radio" name="bankuai_shuliang" value="多发" class="minimal">&nbsp;&nbsp;多发

                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>形态(1=不规则,0=规则)</td>
                        <td><input type="text" name="bankuai_xingtai_left_jingzong" /></td>
                        <td><input type="text" name="bankuai_xingtai_left_doubu"/></td>
                        <td><input type="text" name="bankuai_xingtai_left_jingnei"/></td>
                        <td><input type="text" name="bankuai_xingtai_left_SA"/></td>
                        <td><input type="text" name="bankuai_xingtai_left_VA"/></td>
                        <td><input type="text" name="bankuai_xingtai_right_jingzong" /></td>
                        <td><input type="text" name="bankuai_xingtai_right_doubu"/></td>
                        <td><input type="text" name="bankuai_xingtai_right_jingnei"/></td>
                        <td><input type="text" name="bankuai_xingtai_right_SA"/></td>
                        <td><input type="text" name="bankuai_xingtai_right_VA"/></td>
                    </tr>
                    <tr>
                        <td>溃疡(1=有,0=无)</td>
                        <td><input type="text" name="bankuai_kuiyang_left_jingzong" /></td>
                        <td><input type="text" name="bankuai_kuiyang_left_doubu"/></td>
                        <td><input type="text" name="bankuai_kuiyang_left_jingnei"/></td>
                        <td><input type="text" name="bankuai_kuiyang_left_SA"/></td>
                        <td><input type="text" name="bankuai_kuiyang_left_VA"/></td>
                        <td><input type="text" name="bankuai_kuiyang_right_jingzong" /></td>
                        <td><input type="text" name="bankuai_kuiyang_right_doubu"/></td>
                        <td><input type="text" name="bankuai_kuiyang_right_jingnei"/></td>
                        <td><input type="text" name="bankuai_kuiyang_right_SA"/></td>
                        <td><input type="text" name="bankuai_kuiyang_right_VA"/></td>
                    </tr>
                    <tr>
                        <td>回声(1=强回声,2=中,3=低,4=混合回声)</td>
                        <td><input type="text" name="bankuai_huisheng_left_jingzong" /></td>
                        <td><input type="text" name="bankuai_huisheng_left_doubu"/></td>
                        <td><input type="text" name="bankuai_huisheng_left_jingnei"/></td>
                        <td><input type="text" name="bankuai_huisheng_left_SA"/></td>
                        <td><input type="text" name="bankuai_huisheng_left_VA"/></td>
                        <td><input type="text" name="bankuai_huisheng_right_jingzong" /></td>
                        <td><input type="text" name="bankuai_huisheng_right_doubu"/></td>
                        <td><input type="text" name="bankuai_huisheng_right_jingnei"/></td>
                        <td><input type="text" name="bankuai_huisheng_right_SA"/></td>
                        <td><input type="text" name="bankuai_huisheng_right_VA"/></td>
                    </tr>

                    <tr>
                        <td style="text-align: center;" rowspan="4">狭窄或闭塞</td>
                        <td>狭窄率(0=无,1=1-49%,2=50-69%,3=70-99%,4=闭塞)</td>
                        <td><input type="text" name="xiazhai_xiazhailv_left_jingzong" /></td>
                        <td><input type="text" name="xiazhai_xiazhailv_left_doubu"/></td>
                        <td><input type="text" name="xiazhai_xiazhailv_left_jingnei"/></td>
                        <td><input type="text" name="xiazhai_xiazhailv_left_SA"/></td>
                        <td><input type="text" name="xiazhai_xiazhailv_left_VA"/></td>
                        <td><input type="text" name="xiazhai_xiazhailv_right_jingzong" /></td>
                        <td><input type="text" name="xiazhai_xiazhailv_right_doubu"/></td>
                        <td><input type="text" name="xiazhai_xiazhailv_right_jingnei"/></td>
                        <td><input type="text" name="xiazhai_xiazhailv_right_SA"/></td>
                        <td><input type="text" name="xiazhai_xiazhailv_right_VA"/></td>
                    </tr>
                </table>

            </div>
        </div>
    </div>
    <div class="box-footer">
        <button type="button" class="btn btn-info btn-lg middleBtn" id="CVUSSignIn" onclick="saveCVUS()">保存</button>
    </div>
</form>
<script>

    $(function () {
        if (canUpdate != null && canUpdate != undefined && !canUpdate) {
            $("#CVUSSignIn").hide();
        }


        $("input:radio[name='cvus_is_zhengchang']").on('ifChanged', function (event) {
            if ($(this).is(':checked')) {
                if ($(this).val() == "全部正常") {
                    clearCVUSData();
                } else {
                }
            }
        });
    });

    function clearCVUSData() {
        $("input[name^='neimo_IMT_']").val("");
        $("input:radio[name='bankuai_shuliang']").iCheck("uncheck");
        $("input[name^='bankuai_xingtai_']").val("");
        $("input[name^='bankuai_kuiyang_']").val("");
        $("input[name^='bankuai_huisheng_']").val("");
        $("input[name^='xiazhai_xiazhailv_']").val("");
    }
    function saveCVUS() {
        let d = {};
        let t = $('#CVUSForm').serializeArray();
        $.each(t, function () {
            if (this.value != "") {
                d[this.name] = this.value;
            }
        });
        let data = JSON.stringify(d);
        console.log("CVUSFormData:", data);
        //return false;
        ajaxLoading("正在提交数据...");
        $.post("/infoCollection/save", {type: "CVUS", id: $("#screenId").val(), data: data}, function (resp) {
            ajaxLoadEnd();
            /*alert(resp.msg);
            if (resp.code == 0) {
                window.localStorage.setItem("currentTab","CVUS");
                window.location.reload();
            }*/
            afterUpdateFormData(resp,"CVUS");
        });
    }
    function CVUSInit(CVUSData) {
        $("#CVUSForm").initForm({jsonValue: CVUSData, isDebug: false});
    }

</script>
{{end}}
